using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Manager2D_Scene2D_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Manager2D.Scene2D);
            args = new Type[]{typeof(System.Boolean)};
            method = type.GetMethod("set_TextureMode", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_TextureMode_0);
            args = new Type[]{typeof(System.Int32), typeof(System.Int32)};
            method = type.GetMethod("ReSize", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, ReSize_1);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_2);
            args = new Type[]{};
            method = type.GetMethod("InvokeDispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, InvokeDispose_3);
            args = new Type[]{typeof(huqiang.Manager2D.ScenePage), typeof(System.Object)};
            method = type.GetMethod("ChangeScene", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, ChangeScene_4);
            args = new Type[]{};
            method = type.GetMethod("Update", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Update_5);

            field = type.GetField("Root", flag);
            app.RegisterCLRFieldGetter(field, get_Root_0);
            app.RegisterCLRFieldSetter(field, set_Root_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Root_0, AssignFromStack_Root_0);
            field = type.GetField("camera", flag);
            app.RegisterCLRFieldGetter(field, get_camera_1);
            app.RegisterCLRFieldSetter(field, set_camera_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_camera_1, AssignFromStack_camera_1);
            field = type.GetField("Instance", flag);
            app.RegisterCLRFieldGetter(field, get_Instance_2);
            app.RegisterCLRFieldSetter(field, set_Instance_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Instance_2, AssignFromStack_Instance_2);
            field = type.GetField("CurrentPage", flag);
            app.RegisterCLRFieldGetter(field, get_CurrentPage_3);
            app.RegisterCLRFieldSetter(field, set_CurrentPage_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_CurrentPage_3, AssignFromStack_CurrentPage_3);
            field = type.GetField("texture", flag);
            app.RegisterCLRFieldGetter(field, get_texture_4);
            app.RegisterCLRFieldSetter(field, set_texture_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_texture_4, AssignFromStack_texture_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Manager2D.Scene2D());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Manager2D.Scene2D[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* set_TextureMode_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @value = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.TextureMode = value;

            return __ret;
        }

        static StackObject* ReSize_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @h = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @w = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ReSize(@w, @h);

            return __ret;
        }

        static StackObject* Dispose_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }

        static StackObject* InvokeDispose_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.InvokeDispose();

            return __ret;
        }

        static StackObject* ChangeScene_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @dat = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Manager2D.ScenePage @page = (huqiang.Manager2D.ScenePage)typeof(huqiang.Manager2D.ScenePage).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ChangeScene(@page, @dat);

            return __ret;
        }

        static StackObject* Update_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Manager2D.Scene2D instance_of_this_method = (huqiang.Manager2D.Scene2D)typeof(huqiang.Manager2D.Scene2D).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Update();

            return __ret;
        }


        static object get_Root_0(ref object o)
        {
            return ((huqiang.Manager2D.Scene2D)o).Root;
        }

        static StackObject* CopyToStack_Root_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Manager2D.Scene2D)o).Root;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Root_0(ref object o, object v)
        {
            ((huqiang.Manager2D.Scene2D)o).Root = (UnityEngine.Transform)v;
        }

        static StackObject* AssignFromStack_Root_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Transform @Root = (UnityEngine.Transform)typeof(UnityEngine.Transform).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Manager2D.Scene2D)o).Root = @Root;
            return ptr_of_this_method;
        }

        static object get_camera_1(ref object o)
        {
            return ((huqiang.Manager2D.Scene2D)o).camera;
        }

        static StackObject* CopyToStack_camera_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Manager2D.Scene2D)o).camera;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_camera_1(ref object o, object v)
        {
            ((huqiang.Manager2D.Scene2D)o).camera = (UnityEngine.Camera)v;
        }

        static StackObject* AssignFromStack_camera_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Camera @camera = (UnityEngine.Camera)typeof(UnityEngine.Camera).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Manager2D.Scene2D)o).camera = @camera;
            return ptr_of_this_method;
        }

        static object get_Instance_2(ref object o)
        {
            return ((huqiang.Manager2D.Scene2D)o).Instance;
        }

        static StackObject* CopyToStack_Instance_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Manager2D.Scene2D)o).Instance;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Instance_2(ref object o, object v)
        {
            ((huqiang.Manager2D.Scene2D)o).Instance = (UnityEngine.GameObject)v;
        }

        static StackObject* AssignFromStack_Instance_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.GameObject @Instance = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Manager2D.Scene2D)o).Instance = @Instance;
            return ptr_of_this_method;
        }

        static object get_CurrentPage_3(ref object o)
        {
            return ((huqiang.Manager2D.Scene2D)o).CurrentPage;
        }

        static StackObject* CopyToStack_CurrentPage_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Manager2D.Scene2D)o).CurrentPage;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_CurrentPage_3(ref object o, object v)
        {
            ((huqiang.Manager2D.Scene2D)o).CurrentPage = (huqiang.Manager2D.ScenePage)v;
        }

        static StackObject* AssignFromStack_CurrentPage_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Manager2D.ScenePage @CurrentPage = (huqiang.Manager2D.ScenePage)typeof(huqiang.Manager2D.ScenePage).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Manager2D.Scene2D)o).CurrentPage = @CurrentPage;
            return ptr_of_this_method;
        }

        static object get_texture_4(ref object o)
        {
            return ((huqiang.Manager2D.Scene2D)o).texture;
        }

        static StackObject* CopyToStack_texture_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Manager2D.Scene2D)o).texture;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_texture_4(ref object o, object v)
        {
            ((huqiang.Manager2D.Scene2D)o).texture = (UnityEngine.RenderTexture)v;
        }

        static StackObject* AssignFromStack_texture_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.RenderTexture @texture = (UnityEngine.RenderTexture)typeof(UnityEngine.RenderTexture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Manager2D.Scene2D)o).texture = @texture;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Manager2D.Scene2D();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
